package com.lst.projectlib.dialog;

import android.app.ProgressDialog;
import android.content.Context;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

import com.lst.projectlib.R;



public class CustomProgressDialog extends ProgressDialog {

	private ImageView imageView;

	public CustomProgressDialog(Context context, int theme) {
		super(context, theme);
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.dialog_custom_progress);
		imageView = (ImageView) this.findViewById(R.id.img_view);

		getWindow().getAttributes().dimAmount = 0;
	}

	@Override
	public void show() {
		super.show();
		Animation progressAnimation = AnimationUtils.loadAnimation(
				this.getContext(), R.anim.progress_animation);

		imageView.startAnimation(progressAnimation);
	}

	@Override
	public void dismiss() {
		imageView.clearAnimation();
		super.dismiss();
	}
}
